//
//  FGSystemMessageCellData.m
//  FGChatKit
//
//  Created by Henry on 2021/6/2.
//

#import "FGSystemMessageCellData.h"
#import "UIColor+FGChat.h"
#import "NSString+FGSize.h"

@implementation FGSystemMessageCellData

- (instancetype)init
{
    self = [super initWithDirection:FGMsgDirectionIncoming];
    if (self) {
        [self setupInit];
    }
    return self;
}

- (instancetype)initWithDirection:(FGMsgDirection)direction {
    self = [super initWithDirection:direction];
    if (self) {
        [self setupInit];
    }
    return self;
}

- (void)setupInit {
    _contentFont = [UIFont systemFontOfSize:13];
    _contentColor = [UIColor fg_colorWithLightColor:[UIColor fg_colorWithString:@"#666666"] darkColor:[UIColor fg_colorWithString:@"#DDDDDD"]];
}

- (CGSize)contentSize {
    CGFloat textWidthMax = [UIScreen mainScreen].bounds.size.width * 0.7;

    CGSize size = [self.content fg_textSizeIn:CGSizeMake(textWidthMax, MAXFLOAT) font:self.contentFont];
    return size;
}

+ (NSString *)reuseIdentifier {
    return @"FGSystemMessageCell";
}

@end
